package com.yxhl.km.module.home.mvp;

import com.yxhl.km.module.home.entity.HomeBean;
import com.yxhl.km.module.person.entity.UserInfo;
import com.yxhl.km.mvp.BaseView;

/**
 * Created by 张亚楠 on 2018/5/21.
 * 通过p层将View层和Model进行关联
 */

public class PersonPrensenter {
    private BaseView loginView;
    private PersonMoudle personMoudle;

    public PersonPrensenter(BaseView loginView) {
        this.loginView = loginView;
        this.personMoudle = new PersonMoudle();
    }

    /**
     * 首页数据
     *
     * @param offset
     * @param limit
     */
    public void getListData(String offset, String limit) {
        this.personMoudle.getListData(offset, limit, new ResultBean<HomeBean>() {
            @Override
            public void onError(Throwable e) {

            }

            @Override
            public void onResult(HomeBean userInfoBean) {
                loginView.onResult(userInfoBean);
            }

        });

    }


}
